package entity;

import java.util.Date;

//学号、姓名、性别、出生日期、政治面貌、家庭住址、电话、宿舍号。
public class Student {
	private String stuNo;
	private String stuName;
	private String gender;
	private String birthDate;
	private String politicalStatus;
	private String homeAddress;
	private String telephone;
	private String dormitoryNumber;

	public Student(String stuNo, String stuName, String gender,
			String birthDate, String politicalStatus, String homeAddress,
			String telephone, String dormitoryNumber) {
		super();
		this.stuNo = stuNo;
		this.stuName = stuName;
		this.gender = gender;
		this.birthDate = birthDate;
		this.politicalStatus = politicalStatus;
		this.homeAddress = homeAddress;
		this.telephone = telephone;
		this.dormitoryNumber = dormitoryNumber;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((birthDate == null) ? 0 : birthDate.hashCode());
		result = prime * result
				+ ((dormitoryNumber == null) ? 0 : dormitoryNumber.hashCode());
		result = prime * result + ((gender == null) ? 0 : gender.hashCode());
		result = prime * result
				+ ((homeAddress == null) ? 0 : homeAddress.hashCode());
		result = prime * result
				+ ((politicalStatus == null) ? 0 : politicalStatus.hashCode());
		result = prime * result + ((stuName == null) ? 0 : stuName.hashCode());
		result = prime * result + ((stuNo == null) ? 0 : stuNo.hashCode());
		result = prime * result
				+ ((telephone == null) ? 0 : telephone.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Student other = (Student) obj;
		if (birthDate == null) {
			if (other.birthDate != null)
				return false;
		} else if (!birthDate.equals(other.birthDate))
			return false;
		if (dormitoryNumber == null) {
			if (other.dormitoryNumber != null)
				return false;
		} else if (!dormitoryNumber.equals(other.dormitoryNumber))
			return false;
		if (gender == null) {
			if (other.gender != null)
				return false;
		} else if (!gender.equals(other.gender))
			return false;
		if (homeAddress == null) {
			if (other.homeAddress != null)
				return false;
		} else if (!homeAddress.equals(other.homeAddress))
			return false;
		if (politicalStatus == null) {
			if (other.politicalStatus != null)
				return false;
		} else if (!politicalStatus.equals(other.politicalStatus))
			return false;
		if (stuName == null) {
			if (other.stuName != null)
				return false;
		} else if (!stuName.equals(other.stuName))
			return false;
		if (stuNo == null) {
			if (other.stuNo != null)
				return false;
		} else if (!stuNo.equals(other.stuNo))
			return false;
		if (telephone == null) {
			if (other.telephone != null)
				return false;
		} else if (!telephone.equals(other.telephone))
			return false;
		return true;
	}

	public String getStuNo() {
		return stuNo;
	}

	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}

	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getBirthDate() {
		return birthDate;
	}

	public void setBirthDate(String birthDate) {
		this.birthDate = birthDate;
	}

	public String getPoliticalStatus() {
		return politicalStatus;
	}

	public void setPoliticalStatus(String politicalStatus) {
		this.politicalStatus = politicalStatus;
	}

	public String getHomeAddress() {
		return homeAddress;
	}

	public void setHomeAddress(String homeAddress) {
		this.homeAddress = homeAddress;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getDormitoryNumber() {
		return dormitoryNumber;
	}

	public void setDormitoryNumber(String dormitoryNumber) {
		this.dormitoryNumber = dormitoryNumber;
	}

	@Override
	public String toString() {
		return "Student [stuNo=" + stuNo + ", stuName=" + stuName + ", gender="
				+ gender + ", birthDate=" + birthDate + ", politicalStatus="
				+ politicalStatus + ", homeAddress=" + homeAddress
				+ ", telephone=" + telephone + ", dormitoryNumber="
				+ dormitoryNumber + "]";
	}
    
}
